#!/usr/bin/env python
# coding: utf-8

# 1.随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人

# In[1]:


import numpy as np


# In[4]:


c1_python=np.random.randint(0,100,50)
c1_math=np.random.randint(0,100,50)
c1_chinese=np.random.randint(0,100,50)
c2_python=np.random.randint(0,100,50)
c2_math=np.random.randint(0,100,50)
c2_chinese=np.random.randint(0,100,50)
c3_python=np.random.randint(0,100,50)
c3_math=np.random.randint(0,100,50)
c3_chinese=np.random.randint(0,100,50)
c4_python=np.random.randint(0,100,50)
c4_math=np.random.randint(0,100,50)
c4_chinese=np.random.randint(0,100,50)


# 2.将六个班的考试成绩进行合并得到score

# In[29]:


score_python=np.concatenate([c1_python,c2_python,c3_python,c4_python],axis=0)
score_math=np.concatenate([c1_math,c2_math,c3_math,c4_math],axis=0)
score_chinese=np.concatenate([c1_chinese,c2_chinese,c3_chinese,c4_chinese],axis=0)


# 3.生成性别数组sex，水平叠加数组sex和score得到data

# In[27]:


sex_python=np.random.randint(0,2,200)
sex_math=np.random.randint(0,2,200)
sex_chinese=np.random.randint(0,2,200)





# In[36]:


data_python=np.vstack((score_python,sex_python))
data_math=np.vstack((score_math,sex_math))
data_chinese=np.vstack((score_chinese,sex_chinese))


# 4分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差

# In[47]:


np.max(data_python[0][sex_python==0])
np.min(data_python[0][sex_python==0])
np.mean(data_python[0][sex_python==0])
np.median(data_python[0][sex_python==0])
np.std(data_python[0][sex_python==0])


# In[ ]:


np.max(data_python[0][sex_python==1])
np.min(data_python[0][sex_python==1])
np.mean(data_python[0][sex_python==1])
np.median(data_python[0][sex_python==1])
np.std(data_python[0][sex_python==1])


# In[ ]:


np.max(data_math[0][sex_math==0])
np.min(data_math[0][sex_math==0])
np.mean(data_math[0][sex_math==0])
np.median(data_math[0][sex_math==0])
np.std(data_math[0][sex_math==0])


# In[ ]:


np.max(data_math[0][sex_math==1])
np.min(data_math[0][sex_math==1])
np.mean(data_math[0][sex_math==1])
np.median(data_math[0][sex_math==1])
np.std(data_math[0][sex_math==1])


# In[ ]:


np.max(data_chinese[0][sex_chinese==0])
np.min(data_chinese[0][sex_chinese==0])
np.mean(data_chinese[0][sex_chinese==0])
np.median(data_chinese[0][sex_chinese==0])
np.std(data_chinese[0][sex_chinese==0])


# In[ ]:


np.max(data_chinese[0][sex_chinese==1])
np.min(data_chinese[0][sex_chinese==1])
np.mean(data_chinese[0][sex_chinese==1])
np.median(data_chinese[0][sex_chinese==1])
np.std(data_chinese[0][sex_chinese==1])


# In[ ]:




